import { createSSRApp } from 'vue'
import App from './App.vue'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import shareMixin from './shareMixin/shareMixin'

import { createPinia } from 'pinia'
import uviewPlus from 'uview-plus'
import { directive } from './utils/directive'

export function createApp() {
  const app = createSSRApp(App)
  const pinia = createPinia()
  app.use(pinia.use(piniaPluginPersistedstate))
  // 注册 自定义指令
  directive(app)
  app.use(uviewPlus)
  app.mixin(shareMixin)

  return {
    app
  }
}
